home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
10,000 Great Games
/
10,000 Great Games.iso
/
Product
/
66
/
data1.cab
/
Source_Files
/
Src
/
Rolling.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2000-01-16
|
759b
|
36 lines
#include "stdafx.h"
cRolling::cRolling(int _x, int _y, cProperties *_orig)
: cWeapon(_x, _y, _orig, "MOVING")
{
move_object_after_hit = FALSE;
}
cRolling::~cRolling()
{
}
int cRolling::control()
{
cWeapon::control();
bounce_on_boundaries();
// Rotate
if (circle_bounds != 0)
set_rotation_angle(get_rotation_angle() - 41 * vx * roll_timer.delta() / circle_bounds->radius);
// Kill object if we hit something or when we are in water
return !((abs(vx) > (fix)5 || !resting) && check_radial_hit_one(circle_bounds)) && !in_water();
}
void cRolling::hit(fix dir, cWeapon *w)
{
// Push if weapon has push power
if (w->push_power > 0 || w->instant_push_speed > (fix)0)
add_angular_speed(50, dir);
}